<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: FIFO Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__adcmic__functions__fifo.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">FIFO Functions<div class="ingroups"><a class="el" href="group__group__adcmic.html">ADCMic       (Delta-Sigma ADC with PDM microphone support)</a> &raquo; <a class="el" href="group__group__adcmic__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions are related to ADCMic FIFO buffer. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga220eefbf87371967992dbbd993c747d6"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__fifo.html#ga220eefbf87371967992dbbd993c747d6">Cy_ADCMic_ReadFifoAll</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *base, uint16_t *data)</td></tr>
<tr class="memdesc:ga220eefbf87371967992dbbd993c747d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads whole the FIFO payload into the data array.  <a href="#ga220eefbf87371967992dbbd993c747d6">More...</a><br /></td></tr>
<tr class="separator:ga220eefbf87371967992dbbd993c747d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae4d911c0c8618b2147c6e3deafdbe419"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__fifo.html#gae4d911c0c8618b2147c6e3deafdbe419">Cy_ADCMic_GetFifoStatus</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *base)</td></tr>
<tr class="memdesc:gae4d911c0c8618b2147c6e3deafdbe419"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the fifo status.  <a href="#gae4d911c0c8618b2147c6e3deafdbe419">More...</a><br /></td></tr>
<tr class="separator:gae4d911c0c8618b2147c6e3deafdbe419"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc19dc83856db209d195a1df6e9dcd67"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__fifo.html#gadc19dc83856db209d195a1df6e9dcd67">Cy_ADCMic_ReadFifo</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *base)</td></tr>
<tr class="memdesc:gadc19dc83856db209d195a1df6e9dcd67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Low-level API which returns the ADCMIC_DATA register value that contains <b>two</b> subsequent FIFO data samples.  <a href="#gadc19dc83856db209d195a1df6e9dcd67">More...</a><br /></td></tr>
<tr class="separator:gadc19dc83856db209d195a1df6e9dcd67"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga220eefbf87371967992dbbd993c747d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga220eefbf87371967992dbbd993c747d6">&#9670;&nbsp;</a></span>Cy_ADCMic_ReadFifoAll()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Cy_ADCMic_ReadFifoAll </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads whole the FIFO payload into the data array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware ADCMic block.</td></tr>
    <tr><td class="paramname">data</td><td>The pointer to the uint16_t data array for the FIFO payload.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The 8-bit FIFO data count.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">/* ISR function to handle ADCMic interrupts. </span></div><div class="line"><span class="comment"> * This same routine gets called when any of the enabled ADCMic interrupt sources are enabled.</span></div><div class="line"><span class="comment"> */</span></div><div class="line">uint16_t data[64];</div><div class="line">uint8_t  dataCount;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> ADCMic_Isr(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    <span class="comment">/* Read interrupt status register. */</span></div><div class="line">    uint32_t intrStatus = <a class="code" href="group__group__adcmic__functions__interrupt.html#gae9309c0b0b44c696c3de3a79290ec641">Cy_ADCMic_GetInterruptStatusMasked</a>(MXS40ADCMIC0);</div><div class="line"></div><div class="line">    <span class="comment">/* Check what triggered the interrupt. */</span></div><div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code" href="group__group__adcmic__macros__interrupt.html#ga1a3748aac7c1fb78f2860c7f36d643d6">CY_ADCMIC_INTR_DATA</a> &amp; intrStatus))</div><div class="line">    {</div><div class="line">        <span class="keywordflow">if</span> (0U != (<a class="code" href="group__group__adcmic__macros__fifo__status.html#ga6a606709df5107fdd482ccecde1aea94">CY_ADCMIC_FIFO_EMPTY</a> &amp; <a class="code" href="group__group__adcmic__functions__fifo.html#gae4d911c0c8618b2147c6e3deafdbe419">Cy_ADCMic_GetFifoStatus</a>(MXS40ADCMIC0)))</div><div class="line">        {</div><div class="line">            dataCount = <a class="code" href="group__group__adcmic__functions__fifo.html#ga220eefbf87371967992dbbd993c747d6">Cy_ADCMic_ReadFifoAll</a>(MXS40ADCMIC0, data);</div><div class="line">        }</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* Check also the DC interrupt status, if enabled. */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Clear the handled interrupt. */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__interrupt.html#ga51c3d5c6bdc5fef18119977ded174a28">Cy_ADCMic_ClearInterrupt</a>(MXS40ADCMIC0, intrStatus);</div><div class="line">}</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gae4d911c0c8618b2147c6e3deafdbe419"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae4d911c0c8618b2147c6e3deafdbe419">&#9670;&nbsp;</a></span>Cy_ADCMic_GetFifoStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint8_t Cy_ADCMic_GetFifoStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the fifo status. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware ADCMic block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The 8-bit fifo status, see <a class="el" href="group__group__adcmic__macros__fifo__status.html">FIFO Status Masks</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">/* ISR function to handle ADCMic interrupts. </span></div><div class="line"><span class="comment"> * This same routine gets called when any of the enabled ADCMic interrupt sources are enabled.</span></div><div class="line"><span class="comment"> */</span></div><div class="line">uint16_t data[64];</div><div class="line">uint8_t  dataCount;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> ADCMic_Isr(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    <span class="comment">/* Read interrupt status register. */</span></div><div class="line">    uint32_t intrStatus = <a class="code" href="group__group__adcmic__functions__interrupt.html#gae9309c0b0b44c696c3de3a79290ec641">Cy_ADCMic_GetInterruptStatusMasked</a>(MXS40ADCMIC0);</div><div class="line"></div><div class="line">    <span class="comment">/* Check what triggered the interrupt. */</span></div><div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code" href="group__group__adcmic__macros__interrupt.html#ga1a3748aac7c1fb78f2860c7f36d643d6">CY_ADCMIC_INTR_DATA</a> &amp; intrStatus))</div><div class="line">    {</div><div class="line">        <span class="keywordflow">if</span> (0U != (<a class="code" href="group__group__adcmic__macros__fifo__status.html#ga6a606709df5107fdd482ccecde1aea94">CY_ADCMIC_FIFO_EMPTY</a> &amp; <a class="code" href="group__group__adcmic__functions__fifo.html#gae4d911c0c8618b2147c6e3deafdbe419">Cy_ADCMic_GetFifoStatus</a>(MXS40ADCMIC0)))</div><div class="line">        {</div><div class="line">            dataCount = <a class="code" href="group__group__adcmic__functions__fifo.html#ga220eefbf87371967992dbbd993c747d6">Cy_ADCMic_ReadFifoAll</a>(MXS40ADCMIC0, data);</div><div class="line">        }</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* Check also the DC interrupt status, if enabled. */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Clear the handled interrupt. */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__interrupt.html#ga51c3d5c6bdc5fef18119977ded174a28">Cy_ADCMic_ClearInterrupt</a>(MXS40ADCMIC0, intrStatus);</div><div class="line">}</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gadc19dc83856db209d195a1df6e9dcd67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc19dc83856db209d195a1df6e9dcd67">&#9670;&nbsp;</a></span>Cy_ADCMic_ReadFifo()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_ADCMic_ReadFifo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Low-level API which returns the ADCMIC_DATA register value that contains <b>two</b> subsequent FIFO data samples. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware ADCMic block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The combined 32-bit value of two 16-bit samples. Use <a class="el" href="group__group__adcmic__macros__fifo__samples.html">FIFO Samples definitions</a> to parse it.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    uint16_t samples[2U];</div><div class="line">    uint32_t fifoData = <a class="code" href="group__group__adcmic__functions__fifo.html#gadc19dc83856db209d195a1df6e9dcd67">Cy_ADCMic_ReadFifo</a>(MXS40ADCMIC0);</div><div class="line">    samples[0U] = (uint16_t)_FLD2VAL(CY_ADCMIC_FIFO_FIRST_SAMPLE, fifoData);</div><div class="line">    samples[1U] = (uint16_t)_FLD2VAL(CY_ADCMIC_FIFO_SECOND_SAMPLE, fifoData);</div><div class="line">    <span class="comment">/* now the samples array contains two subsequent data samples */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
